package cn.sxt.array;

/**
 * 数组的3初始化方式
 */
public class Test01 {
    public static void main(String[] args){
        //静态初始化
        int[] a = {2,3,56};
        User[] b = {
                new User(1001,"李一一"),
                new User(1002,"李一二"),
                new User(1003,"李二三")
        };

        //默认初始化
        int[] a1 = new int[10];
        User[] b1 = new User[10];

        //动态初始化（先分配空间再赋值）
        int[] a2 = new int[3];
        a2[0] = 1;
        a2[1] = 2;
        a2[2] = 23;

        User[] b2 = new User[3];
        b2[0] = new User(1001,"圆通");
        b2[1] = new User(1002,"块通");
        b2[2] = new User(1003,"铁通");
    }
}
